:Remote Install
set REMOTE_ADDR=%1
set UID=%2
set PWD=%3
set LOCAL_ADDR=192.168.1.102
set LOCAL_UID=WICRESOFT\i-tingrs
set LOCAL_PWD=Str2845745
set route=\Users\i-tingrs\Desktop\netcare\windows\

net use \\%REMOTE_ADDR%\IPC$ /u:%UID% "%PWD%"
if %errorlevel% gtr 0 goto :wrong
md \\%REMOTE_ADDR%\Admin$\netcare
md \\%REMOTE_ADDR%\Admin$\netcare\netcare_install
copy .\netcare_install \\%REMOTE_ADDR%\Admin$\netcare\netcare_install /y

.\psexec.exe \\%REMOTE_ADDR% -s -c .\client_install.cmd %LOCAL_ADDR% %LOCAL_UID% %LOCAL_PWD% %route%
set status=%errorlevel%
if %status% == 0 goto :WRONG
if %status% == 1 goto :INSTALL
if %status% == 2 goto :UPDATE
if %status% == 3 goto :UPTODATE



:WRONG
echo update/install wrong ip :%REMOTE_ADDR% >> .\log.txt
goto :END

:INSTALL
echo finish install ip :%REMOTE_ADDR% >> .\log.txt
goto :END

:UPDATE
echo finish update ip :%REMOTE_ADDR% >> .\log.txt
goto :END


:UPTODATE
echo netcare-agent is uptodate ip :%REMOTE_ADDR% >> .\log.txt
goto :END

:END
net use \\%REMOTE_ADDR%\IPC$ /d /y